﻿<%@ Page Language="C#" AutoEventWireup="true" Title="创建祠堂" CodeFile="CreateAncestralHall.aspx.cs" Inherits="Users_CreateAncestralHall" %>
<%@ Register assembly="DotNetTextBox" namespace="DotNetTextBox" tagprefix="DNTB" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <asp:PlaceHolder Visible="false" runat="server">
         <script src="../Script/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
    </asp:PlaceHolder>
    <%=this.UI_Head(Base_CurrPath, "", "")%>
    <link rel="stylesheet" type="text/css" href="../Css/Users.css" />
    <link href="../Script/formValidator/style/validator.css" rel="stylesheet" type="text/css" />
    <script src="../Script/formValidator/jquery_last.js" type="text/javascript"></script>
    <script src="../Script/formValidator/formValidator.js" type="text/javascript"></script>
    <script src="../Script/formValidator/formValidatorRegex.js" type="text/javascript"></script>
    <script language="javascript" src="../Script/formValidator/DateTimeMask.js" type="text/javascript"></script>
    <script src="../Script/ConvertTime.js" type="text/javascript"></script> 
    <script src="../Script/province.aspx"></script>
    <script src="../Script/popup.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
        $.formValidator.initConfig({ alertmessage: false, formid: "AncestralHall_Form", onerror: function(msg) { alert(msg) } });
        $("#txtAncestralHallId").formValidator({ tipid: "txtAncestralHallIdTip", defaultvalue: '<%=DefaultValue %>', onshow: "如果需要自己输入祠堂编号,默认请不要输入", onfocus: "祠堂编号不能为空", oncorrect: "输入正确" }).inputValidator({ min: 8, max: 8, empty: { leftempty: false, rightempty: false, emptyerror: "祠堂编号两边不能有空符号" }, onerror: "祠堂编号长度只能为八位,请确认" })
            .ajaxValidator({
                type: "post",
                url: "../AjaxXml/ValidateAncestralHallId.aspx",
                pre_proc: function() {
                var v = 'NewNumber=' + escape($('#txtAncestralHallId').val()) + '&ram=' + Math.random();
                    return v;
                },
                //processdata:true,
                datatype: "html",
                success: function(data) {
                    if (data == 0) {
                        return true;
                    }
                    else if (data == -1) {
                    this.onerror = "该祠堂编号您无权使用";
                        return false;
                    }
                    else if (data == 1) {
                        return true;
                    }
                    else if (data == -2) {
                    this.onerror = "该祠堂编号已经使用";
                        return false;

                    }
                    else if (data == -3) {
                        this.onerror = "该馆号只能为数字!";
                        return false;

                    }
                    else {
                        this.onerror = "未知错误";
                        return false;
                    }
                },
                buttons: $("#Button1"),
                error: function() { alert("服务器没有返回数据，可能服务器忙，请重试"); },
                onerror: "该祠堂编号已使用，请更换!",
                onwait: "正在对祠堂编号进行合法性校验，请稍候..."
            }).defaultPassed();
        $("#txtAncestralHallId").formValidator({onshow:"请输入祠堂编号（八位数字）",onfocus:"祠堂编号只能输入八位数字",oncorrect:"输入正确"}).inputValidator({min:10000000,max:99999999,type:"value",onerrormin:"祠堂编号只能输入八位数字",onerror:"祠堂编号只能输入八位数字，请确认"});
        $("#txtName").formValidator({ tipid: "txtNameTip", onshow: "请输入祠堂名称", onfocus: "祠堂名称不能为空", oncorrect: "输入正确" }).inputValidator({ min: 1, max: 15, empty: { leftempty: false, rightempty: false, emptyerror: "祠堂名称两边不能有空符号" }, onerror: "祠堂名称长度必须在1-15位,请确认" });
        $("#txtPreName").formValidator({ tipid: "txtPreNameTip", onshow: "请输入姓氏", onfocus: "姓氏不能为空", oncorrect: "输入正确" }).inputValidator({ min: 1, max: 10, empty: { leftempty: false, rightempty: false, emptyerror: "姓氏两边不能有空符号" }, onerror: "姓氏长度必须在1-10位,请确认" });
        $("#WebEditor1").formValidator({ tipid: "divContentTip", onshow: "请输入祠堂简介", onfocus: "祠堂简介不能为空", oncorrect: "输入正确" }).inputValidator({ empty: { leftempty: false, rightempty: false, emptyerror: "祠堂简介两边不能有空符号" }, onerror: "祠堂简介不能为空,请确认" });
        });
        function hastemplate()
        {
            var seltemplateId=document.getElementById("templateId");
            if(seltemplateId==null)
            {
                alert("暂无模板,您无法创建!");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<form id="AncestralHall_Form" runat="server">
    <%=this.UI_TopControl()%>
    <div class="topbanner bodyList">
        <div class="body_995">
            <div class="Member_left">
                <%=this.UI_Users_loginOK()%>
                <%=this.UI_UsersDhtList() %>
            </div>
            <div class="Member_Right">
                <div class="Member_right_dht">
                    <img src="../Images/class_hy.jpg" /></div>
                <div class="Member_right_CntLIst">
           
           
           
<table cellpadding="0" cellspacing="0" border="0" width="100%" align=center>

  <tr>
	<td height="25" align="center" bgcolor="#E3DEBE" class="title">创建祠堂</TD>
    </tr>
    <tr align="center" class="tdbg" > 
      <td height="40">
            
             <asp:Panel ID="Panel2" runat="server" Visible="true" >    
                <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF">

                
               
                        <tr>
            <td width="18%" align="center" style="padding:4px;" ><strong>祠堂编号:		</strong></td>
            <td width="82%" align="left" style="padding:4px;"class="tdIndiv"  ><div><asp:TextBox ID="txtAncestralHallId"  MaxLength="30"
                    runat="server" Width="162px"></asp:TextBox></div> <DIV  id="txtAncestralHallIdTip" ></Div></td></tr>
                <tr>
            <td width="18%" align="center" style="padding:4px;" ><strong>祠堂名称:		</strong></td>
            <td width="82%" align="left" style="padding:4px;"class="tdIndiv"  ><div><asp:TextBox ID="txtName"  MaxLength="30"
                    runat="server" Width="162px"></asp:TextBox></div> <DIV  id="txtNameTip" ></Div></td></tr>
                    <tr>
            <td width="18%" align="center" style="padding:4px;" ><strong>姓氏:		</strong></td>
            <td width="82%" align="left" style="padding:4px;"class="tdIndiv"  ><div><asp:TextBox ID="txtPreName"  MaxLength="30"
                    runat="server" Width="162px"></asp:TextBox></div> <DIV  id="txtPreNameTip" ></Div></td></tr>
            <tr>
                <td align="center" style="padding:4px;" width="18%">
                    <strong>所属分站: </strong>
                </td>
                <td align="left" style="padding:4px;" width="82%">
                    <select ID="selProvice" name="selProvice" 
                        onChange="changeProvince(document.getElementById('selProvice'),document.getElementById('selCity'));">
                    </select>
                    <select ID="selCity" name="selCity">
                    </select>

                    <script language="javascript" type="text/javascript">
                                    initialize(document.getElementById('selProvice'), document.getElementById('selCity'), "23", "195");
                                </script>

                </td>
                        <tr>
                            <td align="center" style="padding:4px;" width="18%">
                                <strong>祠堂简介: </strong>
                            </td>
                            <td align="left" class="tdIndiv" style="padding:4px;" width="82%">
                                <div>
                                    <DNTB:WebEditor ID="WebEditor1" runat="server" />
                                    <div ID="divContentTip" class="red_FF">
                                        *</div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" style="padding:4px;" width="18%">
                                <strong>模板选择: </strong>
                            </td>
                            <td align="left" style="padding:4px;" width="82%">
                                <%=tempBll.TemplateList(AspNetCs.Enumerations.Channel_Enum.Channel_Type.clan,0,(int)Base_GetUserInfo.Point,configInfo.ancestralhallPoint) %></td>
                        </tr>
                        <tr>
                            <td align="center" style="padding:4px;" width="18%">
                                &nbsp;</td>
                            <td align="left" style="padding:4px;" width="82%">
                                <asp:Button ID="btnCreate" runat="server" onclick="btnCreate_Click" 
                                   OnClientClick="return hastemplate();"  Text="立即添加" />
                            </td>
                        </tr>

              
                </table>
                 
             </asp:Panel>
            
            
                    
                    
                </td>
                    </tr>
    </table>   
           
           
           
           
                    
                </div>
            </div>
        </div>
        <br />
    </div>
    <%#Eval("MuId") %>
    
    <!-- 弹出层 -->
    <div id="divPop" style="position: absolute; display:none;
        width: 107px; height: 145px;">
        <div style="text-align: center;">
            <img src="../images/nopic.jpg"  id="ThumbImg" onload="javascript:DrawImage(this,107,145);" />
        </div>
    </div>
    
     <!-- 弹出层 -->
    <div id="divPopTwo" style="position: absolute; display:none;
        width: 107px; height: 145px;">
        <div style="text-align: center;">
            <img src="../images/nopic.jpg"  id="ThumbImgTwo" onload="javascript:DrawImage(this,107,145);" />
        </div>
    </div>
    
    
</form>   
</body>
</html>

